package io.zhengsh.util;

import java.util.Calendar;

public class DateTimeUtil {

    public static boolean isWorkTime() {
        try {
            //使用静态方法获取实例，默认为当前的时间日期
            Calendar calendar = Calendar.getInstance();
            //获取时
            int h = calendar.get(Calendar.HOUR_OF_DAY);
            return h >= 10 && h <= 22;
        } catch (Throwable t) {
            t.printStackTrace();
        }
        return false;
    }
}
